//
//  PCDApiRemoveStorage.m
//  PCDBank
//
//  Created by lyy on 2021/3/17.
//  Copyright © 2021 DK. All rights reserved.
//

#import "PCDApiRemoveStorage.h"
#import "PCDDataBaseModel.h"

@implementation PCDApiRemoveStorage

- (void)handler:(id)data andContext:(PCDContext *)context ResponseCallback:(WVJBResponseCallback)responseCallback {
    
    NSDictionary *parameters = (NSDictionary *)data;
    NSString *callBack = [parameters objectForKey:@"success"];
    
    NSString *keyString = [parameters objectForKey:@"key"];
    if (!keyString) {
        keyString = @"default";
    }
    [[PCDDataBaseModel shareModel].memoryStorage removeObjectForKey:keyString];
    [[PCDDataBaseModel shareModel] removeStorageFromDataBaseWith:parameters];
    evaluateJavaScriptOnMainThread_quotes(self, callBack, @"");
}

@end
